<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layouts/layout" th:with="header='波次管理', subtext='管理系统中波次'" style="overflow: hidden;">

<head>
    <title>波次</title>
</head>
<body style="overflow: hidden;">

<th:block layout:fragment="content">
    <div id="query-area" class="box-body m-b-sm border-bottom">
        <form class="form-horizontal search-form" role="form">
            <div class="row">
                <div class="row">
                <div class="col-sm-3">
                    <div class="form-group">
                        <label class="control-label col-sm-3">波次单号</label>
                        <div class="col-sm-9">
                            <input type="text" id="documentNumber" name="documentNumber"
                                   placeholder="输入波次号或参考号搜索" class="form-control"/>
                        </div>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="form-group">
                        <label class="control-label col-sm-3">物料编码</label>
                        <div class="col-sm-9">
                            <input type="text" id="material" name="material" placeholder="输入物料编码或名称搜索" class="form-control" />
                        </div>
                    </div>
                </div>


                <div class="text-left">
                    <div class="col-sm-3">
                        <div class="form-group">
                            <label class="control-label col-sm-3">状态</label>
                            <div class="col-sm-9">
                                <select name="status" id="status" class="form-control">
                                    <option value="">请选择</option>
                                    <option value="0000">创建单据</option>
                                    <option value="0300">完全分配</option>
                                    <option value="0250">部分分配</option>
                                    <option value="0650">部分拣选</option>
                                    <option value="0700">出库完成</option>
                                    <option value="0880">关闭</option>
                                </select>

                            </div>
                        </div>
                    </div>
                </div>


                </div>  <!-- row -->

                <div class="row">
                    <!--
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <label class="control-label col-lg-4 label-width-1">日期起</label>
                                                <div class="col-lg-8"> <input id="fromdate" name="fromdate" class="form-control form_datetime">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <label class="control-label col-lg-4 label-width-1">至</label>
                                                <div class="col-lg-8"> <input id="todate" name="todate" class="form-control form_datetime">
                                                </div>
                                            </div>
                                        </div>

                                        -->

                    <div class="col-sm-3">
                        <div class="form-group">
                            <label class="control-label col-sm-3">日期起</label>
                            <div class="col-sm-9">
                                <input id="fromdate" name="fromdate" class="form-control form_datetime">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <label class="control-label col-sm-3">至</label>
                            <div class="col-sm-9">
                                <input id="todate" name="todate" class="form-control form_datetime">
                            </div>
                        </div>
                    </div>

                </div>

                <!--
                <div class="col-sm-3">
                    <div class="form-group">
                        <label class="control-label col-lg-3">单证类型</label>
                        <div class="col-lg-9">
                            <select id="type" name="type" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="a : ${@CODES.findByType('SO_TYPE')}" th:value="${a.value}"
                                        th:text="${a.name}"/>
                            </select>
                        </div>
                    </div>
                </div>
                -->

                <!--
                <div class="col-sm-3">
                  <div class="form-group">
                    <label class="control-label col-lg-3">物料</label>
                    <div class="col-lg-9">
                      <select id="material" name="material" class="form-control select2">
                        <option value="">请选择</option>
                             <option th:each="a : ${@DATAS.materials}" th:value="${a.id}" th:text="${a.name}" th:selected="${params['material'] == ''+a.id}" />
                      </select>
                    </div>
                  </div>
                </div>
                 -->
                <div class="row m-t">
                    <div class="col-lg-12 seach-button">
                        <div class="pull-right">
                            <button type="submit" id="search" class="btn btn-primary">
                                <i class="fa fa-search"></i> 搜索
                            </button>
                            <button type="reset" id="clear" class="btn btn-danger">
                                <i class="fa fa-remove"></i> 清除
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="box">
                <div class="box-body">
                    <h2>
                        <!--
                        <a class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/add|}" th:title="添加发波次">
                            <i class="fa fa-fw fa-plus"></i> 添加
                        </a>
                           -->
                        <a class="btn btn-info btn-sm promptAll" href="javascript:;" th:title="波次优先出库">
                            <i class="fa fa-fw fa-plus"></i> 优先出库
                        </a>
                        <button type="button" class="btn btn-primary btn-sm pickstationAll">
                            <i class="fa fa-edit"></i>拣货口
                        </button>
                        <a class="btn btn-success btn-sm executeAll" href="javascript:;" th:title="分配波次，执行出库">
                            <i class="fa fa-refresh"></i> 执行出库
                        </a>
                        <!--
                        <a class="btn btn-primary btn-sm printSheetAll" href="javascript:;" th:title="打印拣货清单">
                            <i class="fa fa-fw fa-plus"></i> 打印
                        </a>

                        <a class="btn btn-primary btn-sm activeAll" href="javascript:;" th:title="激活波次点亮电子标签">
                            <i class="fa fa-fw fa-plus"></i> 激活
                        </a>
                        <a class="btn btn-primary btn-sm closeAllActive" href="javascript:;"
                           th:title="关闭激活波次点亮电子标签">
                            <i class="fa fa-fw fa-plus"></i> 关闭激活
                        </a>
                        <a class="btn btn-primary btn-sm allocateSoAll" href="javascript:;"
                           th:title="拆分分配数量给订单">
                            <i class="fa fa-fw fa-plus"></i>分波
                        </a>
                           -->
                        <a class="btn btn-warning btn-sm closeAll" href="javascript:;" th:title="关闭波次">
                            <i class="fa fa-remove"></i> 关闭
                        </a>
                        <a class="btn btn-danger btn-sm delAll" href="javascript:;" th:title="删除波次">
                            <i class="fa fa-fw fa-trash"></i> 删除
                        </a>
                    </h2>
                    <div id="tableWrapper">
                        <table id="table" class="table table-striped table-hover table-bordered table-fixed">
                            <thead style="position:sticky;top:0;z-index:10;">
                            <tr>
                                <th style="width:50px;">
                                    <a href="javascript:;" class="selectAll" title="全选">全选</a>
                                </th>
                                <th style="width:100px;">波次单号</th>
                                <th style="width:70px;">出库规则</th>
                                <th style="width:80px;">是否插队</th>
                                <th style="width:70px;">创建人</th>
                                <th style="width:140px;">创建时间</th>
                                <th style="width:80px;">状态</th>
                                <th style="width:180px;">订单WBS</th>
                                <th style="width:100px;">拣选站台</th>
                                <th style="width:70px;">波次详情</th>
                                <th style="width:70px;">订单详情</th>
                                <th style="width:210px;">备注</th>
                               <!-- <th style="width:50px;">激活</th>-->
                                <th style="width:100px;">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <form id="promptForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/prompt|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="executeForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/execute|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="printSheetForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/printsheet|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="allocateSoForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/allocateso|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="activeForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/active|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>
    <form id="closeAllActiveForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/closeAllActive|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="closeForm" method="post" style="display: none" th:action="@{|${baseUrl}/close|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <form id="delForm" method="post" style="display: none" th:action="@{|${baseUrl}/del|}">
        <input id="ids" type="hidden" name="ids"/>
    </form>

    <div class="modal fade" id="myModal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">拣选口选中</h4>
                </div>
                <div class="modal-body">
                    <form id="pickstationForm" method="post" th:action="@{|${baseUrl}/ca/pickstation|}">
                        <input id="ids" type="hidden" name="ids"/>
                    <div class="row">

                        <div class="col-md-6">
                            <div>
                                <input type="checkbox" name="pickstations-x-allbox" id="pickstations-x-allbox" value="">
                                <label for="pickstations-x-allbox"><font size="16" color="aqua">库西区</font></label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA1023" id="pickstation-x1">
                                <label for="pickstation-x1">拣选口1</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA1028" id="pickstation-x2">
                                <label for="pickstation-x2">拣选口2</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA1033" id="pickstation-x3">
                                <label for="pickstation-x3">拣选口3</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA1038" id="pickstation-x4">
                                <label for="pickstation-x4">拣选口4</label>
                            </div>
                        </div>

                        <div class="col-md-6">
                            <div>
                                <input type="checkbox" name="pickstations-d-allbox" id="pickstations-d-allbox" value="">
                                <label for="pickstations-d-allbox"><font size="16" color="aqua">库东区</font></label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA2023" id="pickstation-d1">
                                <label for="pickstation-d1">拣选口1</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA2028" id="pickstation-d2">
                                <label for="pickstation-d2">拣选口2</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA2033" id="pickstation-d3">
                                <label for="pickstation-d3">拣选口3</label>
                            </div>
                            <div>
                                <input type="checkbox" name="pickstations" value="PA2038" id="pickstation-d4">
                                <label for="pickstation-d4">拣选口4</label>
                            </div>
                        </div>


                    </div>

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="pickstation-btn">确定</button>
                </div>
            </div>
        </div>
    </div>



    <!-- Modal -->
    <div class="modal fade" id="waveDetailModal" tabindex="-1">
        <div class="modal-dialog" style="width:90%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">波次详情</h4>
                </div>
                <div class="modal-body" style="height: calc(100vh - 150px);">
                    <iframe style="width: 100%;height: 100%;" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="orderDetailModal" tabindex="-1">
        <div class="modal-dialog" style="width:90%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">订单详情</h4>
                </div>
                <div class="modal-body">
                    <iframe style="width: 100%; height: 450px;" frameborder="0"></iframe>
                </div>

            </div>
        </div>
    </div>

</th:block>

<th:block layout:fragment="scripts">
    <!-- jQuery UI -->
    <script th:inline="javascript">
        var VALUES_MAP_DICT_TYPE = /*[[${@CODES.valuesMapOfType('SO_TYPE')}]]*/ {};
        var VALUES_MAP_DICT_STATUS = /*[[${@CODES.valuesMapOfType('SO_STATUS')}]]*/ {};
    </script>
    <script th:src="@{|${theme}/js/app/outbound/wave_list.js?v=${applicationVersion}|}" th:inline="javascript"></script>

    <script th:src="@{|${theme}/plugins/datetimepicker/bootstrap-datetimepicker.min.js?v=${applicationVersion}|}" th:inline="javascript"></script>
    <script th:src="@{|${theme}/plugins/datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js?v=${applicationVersion}|}" th:inline="javascript"></script>

</th:block>





</body>

</html>
